<template>
  <div>
    <h4>按钮组件</h4>
    <button @click="x++">{{ x }}</button>
  </div>
</template>
<script>
export default {
  data() {
    return {
      x: 100,
    };
  },
  watch: {
    x: {
      immediate: true,
      handler(val) {
        this.$emit("getX", val);
      },
    },
  },
};
</script>
